﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>plupload</title>
    <link rel="stylesheet" href="js/jquery-ui.css" />
    <link href="js/jquery.ui.plupload/css/jquery.ui.plupload.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <script src="js/jquery-ui.min.js" type="text/javascript"></script>
    <script src="js/plupload.full.min.js" type="text/javascript"></script>
    <script src="js/jquery.ui.plupload/jquery.ui.plupload.min.js" type="text/javascript"></script>
    <script src="js/i18n/zh_CN.js" type="text/javascript"></script>
</head>
<body>
    <div id="uploader">
        <p>你的浏览器不支持Flash，Silverlight或HTML5。</p>
    </div>
    <script type="text/javascript">
        $(function() {
            $("#uploader").plupload({
                runtimes: 'html5,flash,silverlight,html4',
                url: 'UploadHandler.ashx',
                max_file_size: '2gb',
                chunk_size: '1mb',
                filters: [
                    { title: "可上传文件", extensions: "jpg,gif,png" }
                ],
                rename: true,
                sortable: true,
                views: {
                    list: true,
                    thumbs: true,
                    active: 'thumbs'
                },
                flash_swf_url: '../../js/Moxie.swf',
                silverlight_xap_url: '../../js/Moxie.xap',
                init: {
                    FileUploaded: function(up, file, info) {
                    },
                    UploadComplete: function(up, file, info) {
                    },
                    Error: function(up, file, info) {
                        if (file.response != undefined) {
                            var json = $.parseJSON(file.response);
                            var msg = "<strong>" + json.Title + "</strong>";
                            msg += "<br/>";
                            msg += "<i>" + json.Message + "</i>";
                            $('#uploader').plupload('notify', 'error', msg);
                        }
                    }
                }
            });
        });
    </script>
</body>
</html>
